<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <title>
        async与await语法糖
    </title>
</head>

<body>
</body>
<script>
async function hd() {
    let name = await new Promise((resolve) => {
        setTimeout(() => {
            resolve("后盾人");
        }, 2000);
    });
    let site = await new Promise((resolve) => {
        setTimeout(() => {
            resolve(name + "houdunren.com");
        }, 2000);
    });
    console.log(site);
}
hd();
console.log(hd());
</script>

</html>